let state = {

  //isExit  0  未登录
  loginState:{
    isExit:0,
    user_id:'',
    token:'',
    user_name:'',
    company_id:'',
    company_name:'',
    company_pid:'',
    company_num:''
  },
  height:500,
  company_id:'',
  partScholl:{
    defaultIcon:0
  }
}

let getters = {
  ratio(state) {
    return state.scene.width / state.scene.height
  }
}

let mutations = {
  changeHeight(state,payload){
    state.height = payload.height||sessionStorage.getItem('height');
    console.log(state.height)
  },
  changeWidth(state,payload){
    state.width = payload.width||sessionStorage.getItem('width');
    console.log(state.height)
  },
  changeLoginStatus(state,payload){
    // console.log(payload)
    state.loginState.isExit =payload.isExit
  },
  saveUid(state,payload){
    state.loginState.user_id =payload.uid;
    state.loginState.token =payload.token;
    state.loginState.user_name =payload.user_name;
    state.loginState.company_id=payload.company_id;
    state.loginState.company_name =payload.company_name;
    state.loginState.company_pid =payload.company_pid;
    state.loginState.company_num =payload.company_num;
  },
  getUserCompanyId(state,payload){
    state.company_id =payload.company_id
  }
}

let actions = {}

export default {
  state,
  getters,
  mutations,
  actions
}
